package com.huixuebao.api.controller.category;

import com.huixuebao.api.dto.CategoryDTO;
import com.huixuebao.api.service.rpc.CategoryService;
import com.huixuebao.common.bean.ApiResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Slf4j
@RestController
@RequestMapping("/category")
public class CategoryController {

    @Autowired
    CategoryService categoryService;

    @GetMapping("/categoryTree")
    public ApiResult<List<CategoryDTO>> categoryTree() {
        return categoryService.categoryTree();
    }
}
